package com.hlddz.venue_reservation.mapper;

import com.hlddz.venue_reservation.entity.User;
import com.hlddz.venue_reservation.entity.Visitor;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author MoShang
 * @since 2024年05月31日
 */
@Mapper
public interface VisitorMapper extends BaseMapper<Visitor> {

    @Insert("INSERT INTO visitor (visitor_id, visitor_name, username) VALUES (#{visitorId}, #{visitorName}, #{username})")
    void addVisitor(Visitor visitor);

    @Delete("DELETE FROM visitor WHERE username = #{username}")
    void delVisitor(@Param("username") String username);

    @Select("SELECT visitor_id,visitor_name FROM visitor WHERE username = #{username}")
    List<Visitor> getVisitorInfo(@Param("username") String username);


}
